<template>
  <div class="app">
    <h2>我是App组件</h2>
    <Suspense>
      <template v-slot:default>
        <Child />
      </template>
      <template v-slot:fallback>
       <h2>稍等一下....</h2>
      </template>
    </Suspense>
  </div>
</template>

<script>
import { defineAsyncComponent } from "vue";
const Child = defineAsyncComponent(() => import("./components/Child.vue")); // 异步引入
// import Child from './components/Child.vue'
export default {
  name: "App",
  components: { Child },
  setup() {
      
  },
};
</script>

<style>
.app {
  padding: 10px;
  background-color: gray;
}
</style>
